package fnord.illuminati.action.actions;

import fnord.illuminati.action.AttackModifierAction;
import fnord.illuminati.card.Alignment;
import fnord.illuminati.card.groupcards.Mafia;
import fnord.illuminati.order.AttackOrder;
import fnord.illuminati.order.AttackType;

public class MafiaAction implements AttackModifierAction {
	private static final long serialVersionUID = 3876245133105128509L;

	@Override
	public int doAttack(AttackOrder order) {
		if (order.getAttackType() == AttackType.CONTROL && order.getFrom() instanceof Mafia) {
			for (Alignment a:order.getTo().getAlignments()) {
				if (a == Alignment.CRIMINAL)
					return 3;
			}
			return 0;
		}
		else
			return 0;
	}

	@Override
	public int doDefend(AttackOrder order) {
		return 0;
	}
}
